package com.bonana.core.dao.user;
import com.bonana.core.entity.CoreUser;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

public interface CoreUserDAO {

    int register(CoreUser coreUser);

    int isExists(@Param("username") String username);

    int isExistsOpenid(@Param("openid") String openid);

    CoreUser queryUserByUid(@Param("userId") int userId);

    CoreUser queryUserByUsername(@Param("username") String username);

    CoreUser queryUserByUsernameAndPassword(@Param("username") String username, @Param("password") String password);

    int updatePassword(@Param("username") String username, @Param("password") String password);

    int updateLastLogin(@Param("username") String username, @Param("lastLoginIp") int lastLoginIp, @Param("lastLoginTime") Timestamp lastLoginTime);

    int updateStatus(@Param("uid") int uid, @Param("status") int status);

    int countByDate(@Param("beginTime") String beginTime, @Param("endTime") String endTime);

    int countByDateTs(@Param("beginTime") Timestamp beginTime, @Param("endTime") Timestamp endTime);

    int DelBobo(@Param("userId") int userId);
}